package cn.wolfcode.luowowo.search.query;

import cn.wolfcode.luowowo.common.query.QueryObject;
import lombok.Getter;
import lombok.Setter;
import org.springframework.data.domain.PageRequest;

/**
 * 搜索qo
 */
@Setter
@Getter
public class SearchQueryObject extends QueryObject{

    //全部
    public static final int SEARCH_TYPE_ALL = -1;
    //目的地
    public static final int SEARCH_TYPE_DEST = 0;
    //攻略
    public static final int SEARCH_TYPE_STRATEGY = 1;
    //游记
    public static final int SEARCH_TYPE_TRAVEL = 2;
    //找人
    public static final int SEARCH_TYPE_USER = 3;

    //类型
    private Integer type = -1;

    public PageRequest getPageRequest() {
        return PageRequest.of(super.getCurrentPage() - 1, super.getPageSize());
    }
}
